import time

# for i in range(3600):
#     print('hello, world')
#     time.sleep(0.1)
# for _ in range(3600):
#     print('hello, world')
#     time.sleep(0.1)
# total = 0
# i = 1

# while True:
#     i += 1
#     if i % 2 == 0:
#         total += i
#     if i > 100:
#         break
# print(total)
# for i in range(1, 101):
#     if i % 2 != 0:
#         print('000')
#         continue
#         print('111')
#     total += i
# print(total)

# for i in range(1, 10):
#     for j in range(1, i+1):
#         print('%.f * %.f = %.f' % ( j, i, i*j), end="\t")
#     print()
import random
total = 1000
while (total > 0):
    print(f'你的总资产为: {total}元')
    debltValue = int(input('请输入你下注的金额：'))
    # print() 玩家第一次摇筛
    first_point = random.randrange(1, 7) + random.randrange(1, 7)
    print(f'\n玩家摇出了{first_point}点')
    while True:
        if first_point == 7 or first_point == 11:
            print('玩家胜!\n')
            total += debltValue
            break
        elif first_point == 2 or first_point == 3 or first_point == 12:
            print('庄家胜!\n')
            total -= debltValue
            break
        else:
            second_point = random.randrange(1, 7) + random.randrange(1, 7)  # 继续玩法
            print(f'玩家摇出了{second_point}点')
            if second_point == 7:
                print('庄家胜!\n')
                total -= debltValue
                break
            elif second_point == first_point:
                print('玩家胜!\n')
                total += debltValue
                break


print('玩家破产')
# num = random.randrange(1, 7)
# print(num)